<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:p="http://primefaces.org/ui">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
	<script language="javascript" type="text/javascript" src="../../files/js/validacoes.js"></script>
</h:head>

<h:body>
	<h:form id="formCadastro" >

		<p:panel style=" ">
			<div>
				<h:panelGrid id="gridGeral" columns="2">

					<h:outputText value="Login      *" />
					<p:inputText value="#{loginBean.tLogin}" required="true" />

					<h:outputText value="Senha      *" />
					<p:password value="#{loginBean.tSenha}" required="true" feedback="true" inline="true" 
            			weakLabel="Fraca" goodLabel="Boa" strongLabel="Otima"
            			promptLabel="Entre com a senha." />

					<h:outputText value="Nome       *" id="nome" />
					<p:inputText value="#{loginBean.tNome}" required="true"/>

					<h:outputText value="CPF        *" />
					<p:inputMask value="#{loginBean.tCpf}" mask="999.999.999-99" required="true"/>

					<h:outputText value="Data de Nascimento" />
					<p:calendar value="#{loginBean.tDtNasc}" showOn="button" 
					pattern="dd/MM/yyyy" locale="pt"/>

					<h:outputText value="Sexo"></h:outputText>
					<h:selectOneRadio value="#{loginBean.tSexo}">
						<f:selectItem itemLabel="M" itemValue="M"></f:selectItem>
						<f:selectItem itemLabel="F" itemValue="F"></f:selectItem>
					</h:selectOneRadio>

					<h:outputText value="E-mail     *" />
					<p:inputText value="#{loginBean.tEmail}" required="true"/>

					<h:outputText value="Telefone" />
					<p:inputMask value="#{loginBean.tTelefone}" mask="(99)9999-9999" />

					<h:outputText value="Celular" />
					<p:inputMask value="#{loginBean.tCelular}" mask="(99)99999-9999" />

					<h:outputText value="Endereço" />
					<p:inputText value="#{loginBean.tEndereco}" />

					<h:outputText value="Tipo Usu&aacute;rio: "></h:outputText>
					<h:selectOneRadio id="tipoUsuario"
						value="#{loginBean.tTipoUsuario}" onclick="tipoUsu()">
						<f:selectItem itemLabel="Paciente" itemValue="P" checked="checked"></f:selectItem>
						<f:selectItem itemLabel="M&eacute;dico" itemValue="M"></f:selectItem>
					</h:selectOneRadio>

				</h:panelGrid>

				<div id="geral">
					<div id="medico" style="position: absolute; visibility: hidden; margin-left: 21%">
						<h:panelGrid id="gridMedico" columns="2">

							<h:outputText value="CRM" />
							<p:inputText value="#{loginBean.tCrm}" />

							<h:outputText value="Nome da Clinica" />
							<h:selectOneMenu value="#{loginBean.tNomeClin}" >  
				                <f:selectItem itemLabel="Campinas" itemValue="Campinas"/>
					            <f:selectItem itemLabel="Carapicuiba" itemValue="Carapicuiba"/>
				                <f:selectItem itemLabel="Guarulhos" itemValue="Guarulhos"/>  
				                <f:selectItem itemLabel="Lapa" itemValue="Lapa"/>
				                <f:selectItem itemLabel="Osasco" itemValue="Osasco"/>
				                <f:selectItem itemLabel="Sao Paulo" itemValue="Sao Paulo"/>
				                <f:selectItem itemLabel="Santos" itemValue="Santos"/>  
		           			</h:selectOneMenu> 

							<h:outputText value="Telefone da Clinica" />
							<p:inputMask value="#{loginBean.tTelClin}" mask="(99)9999-9999" />

							<h:outputText value="Endereço da Clinica" />
							<p:inputText value="#{loginBean.tEndClin}" />

							<h:outputText value="CNPJ da Clinica" />
							<p:inputMask value="#{loginBean.tCnpjClin}"
								mask="999.999.999/9999-99" />

							<h:outputText value="Especialidade: " />
							<h:selectOneMenu value="#{loginBean.tEspecialidade}" >  
				                <f:selectItem itemLabel="Selecione a Especialidade"  itemValue="Selecione" />
		                		<f:selectItem itemLabel="Acupuntura" itemValue="Acupuntura"/>
				                <f:selectItem itemLabel="Cardiologista" itemValue="Cardiologista"/>
				                <f:selectItem itemLabel="Clinica Geral"  itemValue="Clinica Geral"/> 
				                <f:selectItem itemLabel="Cirurgiao" itemValue="Cirurgiao"/>
				                <f:selectItem itemLabel="Endocrinologista" itemValue="Endocrinologista"/>		                 		               
				                <f:selectItem itemLabel="Ortopedia" itemValue="Ortopedia"/>
				                <f:selectItem itemLabel="Quiropraxia" itemValue="Quiropraxia"/>
				                <f:selectItem itemLabel="Nutricional" itemValue="Nutricionista"/>
				                <f:selectItem itemLabel="Psicologia" itemValue="Psicologia"/>  
		           			</h:selectOneMenu> 

							<h:outputText value="Convenios" />
							<p:selectCheckboxMenu id="convenioM" value="#{loginBean.tListConvenio}" 
							label="Selecione..." filter="true" filterText="Filter" style="width:250px" >
								<f:selectItem itemValue="0" itemLabel="Bradesco Saude"></f:selectItem>
								<f:selectItem itemValue="1" itemLabel="Amil"></f:selectItem>
								<f:selectItem itemValue="2" itemLabel="Blue Life"></f:selectItem>
								<f:selectItem itemValue="3" itemLabel="Golden Cross"></f:selectItem>
								<f:selectItem itemValue="4" itemLabel="Intermedica"></f:selectItem>
								<f:selectItem itemValue="5" itemLabel="Maritima Saude"></f:selectItem>
								<f:selectItem itemValue="6" itemLabel="Medial Health"></f:selectItem>
								<f:selectItem itemValue="7" itemLabel="Porto Seguro Saude"></f:selectItem>
								<f:selectItem itemValue="8" itemLabel="Santa Helena Saude"></f:selectItem>
								<f:selectItem itemValue="9" itemLabel="SulAmerica Saude"></f:selectItem>
								<f:selectItem itemValue="10" itemLabel="Unimed"></f:selectItem>
							</p:selectCheckboxMenu>


						</h:panelGrid>
					</div>
					<div id="paciente" style="top: 0; position: relative;">
						<h:panelGrid id="gridPaciente" columns="2">

							<h:outputText value="Peso Atual" />
							<p:inputMask value="#{loginBean.tPeso}" mask="999.99" />

							<h:outputText value="Altura" />
							<p:inputMask value="#{loginBean.tAltura}" mask="9.99" />

							<h:outputText value="Convenio" />
							<p:selectOneMenu id="convenio" value="#{loginBean.tCodConvenio}" style="width:200px">
								<f:selectItem itemValue="0" itemLabel="Bradesco Saude"></f:selectItem>
								<f:selectItem itemValue="1" itemLabel="Amil"></f:selectItem>
								<f:selectItem itemValue="2" itemLabel="Blue Life"></f:selectItem>
								<f:selectItem itemValue="3" itemLabel="Golden Cross"></f:selectItem>
								<f:selectItem itemValue="4" itemLabel="Intermedica"></f:selectItem>
								<f:selectItem itemValue="5" itemLabel="Maritima Saude"></f:selectItem>
								<f:selectItem itemValue="6" itemLabel="Medial Health"></f:selectItem>
								<f:selectItem itemValue="7" itemLabel="Porto Seguro Saude"></f:selectItem>
								<f:selectItem itemValue="8" itemLabel="Santa Helena Saude"></f:selectItem>
								<f:selectItem itemValue="9" itemLabel="SulAmerica Saude"></f:selectItem>
								<f:selectItem itemValue="10" itemLabel="Unimed"></f:selectItem>
							</p:selectOneMenu>

							<h:outputText value="Tem Dependente?" />
							<h:selectOneRadio id="tipoDependente"	value="#{loginBean.tDependente}" onclick="tipoDepe()">
								<f:selectItem itemLabel="Sim" itemValue="S"></f:selectItem>
								<f:selectItem itemLabel="Não" itemValue="N" checked="checked"></f:selectItem>
							</h:selectOneRadio>


						</h:panelGrid>
					</div>
					<div id="dependente" style="top: 0; position: relative; visibility:hidden;">
						<h:panelGrid id="gridDependente" columns="2">

							<h:outputText value="Nome"></h:outputText>
							<p:inputText value="#{loginBean.tnomeDep}" />

							<h:outputText value="Data de Nascimento"></h:outputText>
							<p:calendar value="#{loginBean.tdtnascDep}" showOn="button" 
							pattern="dd/MM/yyyy" locale="pt"/>

							<h:outputText value="Sexo"></h:outputText>
							<h:selectOneRadio value="#{loginBean.tsexoDep}">
								<f:selectItem itemLabel="M" itemValue="M"></f:selectItem>
								<f:selectItem itemLabel="F" itemValue="F"></f:selectItem>
							</h:selectOneRadio>


							<h:outputText value="Parentesco"></h:outputText>
							<p:inputText value="#{loginBean.tparentescoDep}" />

							<h:outputText value="CPF (Opcional)"></h:outputText>
							<p:inputMask value="#{loginBean.tcpfDep}" mask="999.999.999-99" />

						</h:panelGrid>
					</div>

					<div id="botoes" style="top: 0; position: relative;">
						<h:outputText value="*  Campos Obrigatórios" />
						<h:panelGrid id="gridBotoes" columns="1">
							<p:commandButton value="Salvar" action="#{loginBean.incluir}" update="growl,formCadastro" />
							<p:growl globalOnly="true" id="growl" showDetail="true"	sticky="true"></p:growl>
						</h:panelGrid>
					</div>
				</div>

			</div>
		</p:panel>
	</h:form>
</h:body>	
	   
</html>